<%--
  Created by IntelliJ IDEA.
  User: wang
  Date: 2022/4/1
  Time: 15:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加笔记</title>
    <script src="jquery/jquery-3.5.1.min.js"></script>
</head>
<body>
    <h1>我的工作笔记</h1>
    <form method="post">
        标题：<input type="text" name="title" id="title"><br>
        内容：<textarea name="content" id="content"></textarea>
        类别：<select name="type" id="type">
        <option value="0">请选择类别</option>
        <option value="1">技术</option>
        <option value="2">行政</option>
        <option value="3">人事</option>
        </select>
        <input type="button" value="提交" id="btn">
    </form>
<script>
    $("#btn").click(function () {
        var title=$("#title").val;
        var content=$("#content").val;
        var type=$("#type").val;
        if (title.trin()==""||content.trin()==""||type.trim()==""){
            alert("请填写完整的信息！！！")
        }else{
            $.ajax({
                url:"${pageContext.request.contextPath}/WorkingSrevlet?opr=add",type:"POST",
                data:{"title":title,"content":content,"type":type},
            })
        }
    })
</script>
</body>
</html>
